﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class Passenger
    {
        private Guid _id = Guid.NewGuid();
        [DataMember]
        public Guid ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _eName = string.Empty;
        [DataMember]
        public string EName
        {
            get { return _eName; }
            set { _eName = value; }
        }

        private string _cname = string.Empty;
        [DataMember]
        public string CName
        {
            get { return _cname; }
            set { _cname = value; }
        }

        private string _sex = string.Empty;
        [DataMember]
        public string Sex
        {
            get { return _sex; }
            set { _sex = value; }
        }

        private string _nation = string.Empty;
        [DataMember]
        public string Nation
        {
            get { return _nation; }
            set { _nation = value; }
        }

        private DateTime? _birthDay;
        [DataMember]
        public DateTime? BirthDay
        {
            get { return _birthDay; }
            set { _birthDay = value; }
        }

        private string tel1 = string.Empty;
        [DataMember]
        public string Tel1
        {
            get { return tel1; }
            set { tel1 = value; }
        }

        private string tel2 = string.Empty;
        [DataMember]
        public string Tel2
        {
            get { return tel2; }
            set { tel2 = value; }
        }

        private string _idCardEffective1;
        [DataMember]
        public string IDCardEffective1
        {
            get { return _idCardEffective1; }
            set { _idCardEffective1 = value; }
        }

        private string _idCardEffective2;
        [DataMember]
        public string IDCardEffective2
        {
            get { return _idCardEffective2; }
            set { _idCardEffective2 = value; }
        }

        private bool _effective = true;
        [DataMember]
        public bool Effective
        {
            get { return _effective; }
            set { _effective = value; }
        }

        private string flightCard1 = string.Empty;
        [DataMember]
        public string FlightCard1
        {
            get { return flightCard1; }
            set { flightCard1 = value; }
        }

        private string flightCard2 = string.Empty;
        [DataMember]
        public string FlightCard2
        {
            get { return flightCard2; }
            set { flightCard2 = value; }
        }

        private string flightCard3 = string.Empty;
        [DataMember]
        public string FlightCard3
        {
            get { return flightCard3; }
            set { flightCard3 = value; }
        }

        private string idCardType1 = "身份证";
        [DataMember]
        public string IDCardType1
        {
            get { return idCardType1; }
            set { idCardType1 = value; }
        }

        private string idCardNr1 = string.Empty;
        [DataMember]
        public string IDCardNr1
        {
            get { return idCardNr1; }
            set { idCardNr1 = value; }
        }

        private string idCardType2 = string.Empty;
        [DataMember]
        public string IDCardType2
        {
            get { return idCardType2; }
            set { idCardType2 = value; }
        }

        private string idCardNr2 = string.Empty;
        [DataMember]
        public string IDCardNr2
        {
            get { return idCardNr2; }
            set { idCardNr2 = value; }
        }

        public override bool Equals(object obj)
        {
            Passenger temp = obj as Passenger;
            if (temp == null)
                return false;
            return (this.ID.Equals(temp.ID));
        }

        public override string ToString()
        {
            return string.IsNullOrEmpty( CName) ? EName : CName;
        }
    }
}
